package com.kt.emall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.kt.common.utils.PageUtils;
import com.kt.emall.member.entity.MemberEntity;
import com.kt.emall.member.exception.PhoneExistException;
import com.kt.emall.member.exception.UsernameExistException;
import com.kt.emall.member.vo.MemberLoginVO;
import com.kt.emall.member.vo.MemberRegVO;
import com.kt.emall.member.vo.SocialUser;

import java.util.Map;

/**
 * 会员
 *
 * @author KamTeng
 * @email kamteng1998@qq.com
 * @date 2021-06-14 21:12:13
 */
public interface MemberService extends IService<MemberEntity> {

    /**
     * 分页获取会员信息
     * @param params
     * @return
     */
    PageUtils queryPage(Map<String, Object> params);

    /**
     * 注册
     * @param memberRegVO
     */
    void register(MemberRegVO memberRegVO);

    /**
     * 检查手机号是否唯一
     * @param phone
     * @throws PhoneExistException
     */
    void checkPhoneUnique(String phone) throws PhoneExistException;

    /**
     * 检查用户名是否唯一
     * @param username
     * @throws UsernameExistException
     */
    void checkUsernameUnique(String username) throws UsernameExistException;

    /**
     * 登录
     * @param memberLoginVO
     * @return
     */
    MemberEntity login(MemberLoginVO memberLoginVO);

    /**
     * 社交登录
     * @param socialUser
     * @return
     * @throws Exception
     */
    MemberEntity login(SocialUser socialUser) throws Exception;
}

